Kanzi 3.9.10
kanzi::Renderer Class Reference

#include <kanzi/core.ui/platform/graphics_backend/gl/renderer.hpp>

Classes

struct  RendererSettings
 Settings structure for the renderer construction. More...
 
struct  TextureUnitInfo
 Texture unit information structure. More...
 

Public Types

enum class  BufferAccessMode { ReadOnly , WriteOnly , ReadWrite }
 Mode for accessing a GPU buffer. More...
 
enum  ClearMode {
  ClearModeDisabled , ClearModeUnsignedNormalized , ClearModeUnsignedInteger , ClearModeSignedInteger ,
  ClearModeFloat
}
 Per-color buffer clear setting. More...
 
typedef void(* FramebufferCallback) (unsigned int frameBufferHandle)
 Callback prototype for setActiveFramebuffer.
 
enum  Information {
  InformationGLVendor , InformationGLRenderer , InformationGLVersion , InformationGLShadingLanguageVersion ,
  InformationGLExtensions , InformationFormatSupport , InformationShaderBinarySupport , InformationProgramBinarySupport ,
  InformationFeatureSupport , InformationImplementationDependent , InformationDebug , InformationAll
}
 
enum  RenderingChangeStateFlag {
  RenderingChangeStateFlagNone , RenderingChangeStateFlagColorWriteMode , RenderingChangeStateFlagBlendMode , RenderingChangeStateFlagCullMode ,
  RenderingChangeStateFlagDepthTest , RenderingChangeStateFlagAll
}
 Rendering change flag type. More...
 
enum  Workaround {
  WorkaroundTegra3ColorBufferHalfFloat , WorkaroundAdreno330ColorBufferHalfFloat , WorkaroundChromiumTextureImageUnitCount , WorkaroundAMDCompressedTexStorage ,
  WorkaroundPVRVFrameOESEGLImageExternal , WorkaroundPVRVFrameDepth32f , WorkaroundVivanteDepth32f , WorkaroundFaultyRequiredInternalformat ,
  WorkaroundCount
}
 

Public Member Functions

void addClearColor (unsigned int drawBuffer, ClearMode clearMode)
 Registers color clear with value 0.
 
void addClearColor (unsigned int drawBuffer, ColorRGBA colorRGBA)
 Registers color clear for an unsigned normalized color buffer.
 
void addClearColor (unsigned int drawBuffer, float red, float green, float blue, float alpha)
 Registers color clear for a float color buffer.
 
void addClearColor (unsigned int drawBuffer, int32_t red, int32_t green, int32_t blue, int32_t alpha)
 Registers color clear for a signed integer color buffer.
 
void addClearColor (unsigned int drawBuffer, uint32_t red, uint32_t green, uint32_t blue, uint32_t alpha)
 Registers color clear for an unsigned integer color buffer.
 
void addClearTarget (GraphicsClearTarget target)
 Sets a clear target for the renderer.
 
void advanceGlobalTime (chrono::milliseconds deltaTime)
 Advances the renderer wall clock with time delta.
 
void applyAttributePointer (unsigned int location, int dimension, GraphicsDataType dataType, int stride, const void *data) const
 For a given vertex attribute, specified by attribute location, configures attribute dimension, datatype, stride, and starting offset in the current vertex buffer.
 
void applyAttributePointer (unsigned int location, int dimension, GraphicsDataType dataType, int stride, unsigned int divisor, const void *data) const
 For a given vertex or instance attribute specified by location, configures the dimension, datatype, stride, and starting offset in the current vertex buffer.
 
void applyFixedUniformTime (int uniformLocation)
 Applies the Time fixed uniform.
 
void applyFixedUniformWindowSize (int uniformLocation)
 Applies the WindowSize fixed uniform.
 
void applyTexture (TextureType type, unsigned int textureUnit, unsigned int handle)
 Sets texture settings for a given texture unit.
 
void applyTextureSizeUniforms (ShaderTextureUniform textureUniforms, unsigned int textureWidth, unsigned int textureHeight)
 Applies texture uniforms for the renderer.
 
void applyTransformation (ShaderProgram &shaderProgram)
 Applies transformations from the renderer to the GPU.
 
void applyTransformationUniform (ShaderProgram::FixedUniform uniform, int uniformLocation)
 Applies a single transformation uniform.
 
void applyVertexAttributeArrays ()
 Updates vertex attribute configurations to the graphics driver.
 
void attachShaderToProgram (unsigned int programHandle, unsigned int shaderHandle)
 Attaches a shader to a program.
 
void beginMaterialSetup ()
 Begins a material for the renderer.
 
void beginVertexArray ()
 Begins a set of vertex arrays.
 
void bindAttributeToLocation (unsigned int programHandle, unsigned int locationIndex, kzString attributeName)
 Binds an attribute to a given location index. For example, binds "kzPosition" to 0.
 
void bindFramebuffer (unsigned int frameBufferHandle)
 Binds a framebuffer.
 
void bindRenderbuffer (unsigned int renderbuffer)
 Binds a renderbuffer for editing.
 
unsigned int bindTexture (TextureType type, unsigned int handle)
 Binds specified texture of specified type to the currently active texture unit.
 
void calculateProjectionCameraWorldMatrix ()
 Calculates the projection * camera * world matrix.
 
void clear ()
 Clears the currently bound framebuffer with requested buffers.
 
void clearUniformCaches ()
 Free memory used by uniform caches.
 
bool compileSourceShader (ShaderType shaderType, unsigned int shaderHandle, const char *const shaderCode, string_view shaderName)
 Compiles a source shader and deploys it to the GPU.
 
voidcreateImageObject (void *dataPointer, int target, int *attributes)
 Creates an image object, returns NULL if no hardware support.
 
unsigned int createShader (ShaderType type)
 Creates a shader.
 
unsigned int createShaderProgram ()
 Creates a shader program. Returns the handle to the program.
 
void deleteBuffer (unsigned int handle)
 Deletes vertex, index, or instance buffer.
 
void deleteFramebuffer (unsigned int frameBufferHandle)
 Deletes a framebuffer.
 
void deleteImageObject (void *imageObject)
 Deletes an image object created with createImageObject.
 
void deleteRenderbuffer (unsigned int renderbuffer)
 Deletes a renderbuffer.
 
void deleteShader (unsigned int shaderHandle)
 Deletes a shader.
 
void deleteShaderProgram (unsigned int programHandle)
 Deletes a shader program and the attached shaders.
 
void deleteTexture (unsigned int textureHandle)
 Deletes a texture through the renderer.
 
bool deployBinaryProgram (unsigned int program, unsigned int binaryFormat, const void *data, size_t dataSize)
 Initializes shader program from program binary data.
 
bool deployBinaryShader (unsigned int count, const unsigned int *shaders, unsigned int binaryFormat, const void *data, size_t dataSize)
 Deploys a binary shader.
 
void detachShaderFromProgram (unsigned int programHandle, unsigned int shaderHandle)
 Detaches a shader from a program.
 
void detachTexture (unsigned int textureUnit)
 Detaches all texture information from a given texture unit.
 
void disableState (RendererState state)
 Disables a specific renderer state.
 
void disableVertexAttributeArray (unsigned int attributeHandle)
 Sets vertex attribute array to be disabled.
 
void disableWorkaround (Workaround workaround)
 Disables a renderer workaround.
 
void drawBuffers ()
 Renders the buffers that are currently bound.
 
void enableState (RendererState state)
 Enables a specific renderer state.
 
void enableVertexAttributeArray (unsigned int attributeHandle)
 Sets vertex attribute array to be enabled.
 
void enableWorkaround (Workaround workaround)
 Enables a renderer workaround.
 
void endMaterialSetup ()
 Ends a material for the renderer.
 
void endVertexArray (GraphicsPrimitiveType primitiveType, unsigned int count)
 Ends a vertex array. Renders the specified vertex lists and finishes the usage.
 
GraphicsFormat findValidTextureFormat (GraphicsFormat format, unsigned int features) const
 Finds a valid texture format that is supported by the graphics adapter and is compatible with a given graphics format.
 
void flush () const
 Flushes the GPU pipeline, forces all commands to be executed in finite time.
 
void framebufferRenderbuffer (Surface::APIAttachment attachment, unsigned int renderbuffer)
 Attaches a renderbuffer to the currently active framebuffer.
 
void framebufferTexture2D (unsigned int glTextureImageTarget, Surface::APIAttachment attachment, unsigned int textureHandle, unsigned int mipmapLevel, unsigned int implicitSampleCount)
 Attaches a texture to the currently active framebuffer.
 
unsigned int generateBuffer ()
 Generates new index or vertex buffer or uniform buffer object name.
 
unsigned int generateFramebuffer ()
 Generates new texture for the renderer.
 
void generateMipmaps (TextureType textureType)
 Generates mipmaps for the currently bound texture.
 
unsigned int generateRenderbuffer ()
 Generates a texture for the renderer.
 
unsigned int generateTexture ()
 Generates a new texture for the renderer.
 
SurfaceColorSpace getActiveColorSpace () const
 Gets the active color space.
 
unsigned int getActiveFramebuffer () const
 Gets the active framebuffer handle from the renderer.
 
GLGraphicsOutputgetActiveGLGraphicsOutput () const
 Gets the active surface context from the renderer.
 
KzsGlGraphicsContextgetActiveGraphicsContext () const
 
float getActiveScalar (GraphicsScalar scalar) const
 Returns a current scalar value from the renderer.
 
const intgetActiveShaderAttributeMap () const
 Gets the active vertex attribute map from the renderer.
 
unsigned int getActiveShaderHandle () const
 Gets the active shader handle from the renderer.
 
SurfaceClientAPI getActiveSurfaceClientAPI () const
 
::KzsOpenGlVendor getActiveSurfaceVendor () const
 
unsigned int getBatchCount () const
 Gets the batch count from the renderer. This is the number of draw calls, such as drawElements and drawArrays.
 
int getBlendMode () const
 Gets the blend mode from the renderer.
 
unsigned int getBufferSwitchCount () const
 Gets the number of VBO and IBO switches from the renderer.
 
string getCacheFilePath (const ShaderProgram::CreateInfo &info)
 Forms a full shader cache file path from the shader create info.
 
int getColorReadFormat ()
 Returns the GL constant for the color read format.
 
int getColorReadType ()
 Returns the GL constant for the color read type.
 
GraphicsColorWriteMode getColorWriteMode () const
 Gets the current color write mode from the renderer.
 
GraphicsCullMode getCullMode () const
 Gets the cull mode from the renderer.
 
const voidgetCurrentVertexArrayAttributeData (VertexAttribute::Semantic attribute) const
 Gets the current vertex array data from the renderer. Reset when switching the shader.
 
unsigned int getCurrentVertexArrayFlags () const
 Gets the current vertex array flags from the renderer.
 
GraphicsFormat getDepthStencilFormatForRenderbuffer (bool depth, bool stencil) const
 Returns a depth-stencil renderbuffer format that is supported by the renderer.
 
GraphicsFormat getDepthStencilFormatForTexture (bool depth, bool stencil) const
 Returns a depth-stencil texture format that is supported by the renderer.
 
GraphicsCompareFunction getDepthTest () const
 Gets the depth pass mode from the renderer.
 
DrawBuffers getDrawBuffersSupport () const
 Returns the support for draw buffers.
 
bool getDumpStateOnDrawCalls () const
 Returns current dump state on draw calls setting.
 
GraphicsFormat getFallback (GraphicsFormat format, unsigned int usageFlags) const
 Returns a fallback graphics format that supports given usage flags.
 
unsigned int getFeatures (GraphicsFormat format) const
 Describes the features for which a format can be used in the renderer.
 
FloatTexture getFloatTextureSupport () const
 Returns the support for float texture format.
 
unsigned int getFramebufferSwitchCount () const
 Gets the number of framebuffer switches from the renderer.
 
int getGlesVersion () const
 Returns the supported OpenGL ES version.
 
void getGLFormatTriplet (GraphicsFormat format, unsigned int features, unsigned int *out_glFormat, unsigned int *out_glInternalFormat, unsigned int *out_glType) const
 Writes the GL API format, internal format, and type of a given graphics format to the output parameters.
 
chrono::milliseconds getGlobalTime () const
 Gets the wall clock time in milliseconds since program start.
 
HalfFloatTexture getHalfFloatTextureSupport () const
 Returns the support for half float texture format.
 
HalfFloatVertexAttribute getHalfFloatVertexAttributeSupport () const
 Returns the support for half-float vertex attribute.
 
unsigned int getHeavyweightCallCount () const
 Returns the number of potentially heavyweight calls, such as buffer or texture updates and glFinish, from the renderer.
 
uint64_t getIndexCount () const
 Gets the index count from the renderer.
 
uint64_t getInstanceCount () const
 Gets the instance count from the renderer.
 
float getLineWidth () const
 Gets the line width assigned to the renderer.
 
bool getLogging () const
 Returns whether the logging of OpenGL API calls is enabled.
 
Matrix4x4 getMatrix (FixedMatrix matrixType) const
 Gets a matrix from the renderer.
 
float getMaximumAnisotropy () const
 Gets the maximum anisotropy.
 
unsigned int getMaximumRenderbufferSize () const
 Gets the maximum renderbuffer size.
 
unsigned int getMaximumSampleCount () const
 Gets maximum sample count for multisampling.
 
unsigned int getMaximumTextureSize (TextureType textureType) const
 Gets the maximum texture side size.
 
unsigned int getMaximumVertexAttributeCount () const
 Gets maximum vertex attribute count.
 
unsigned int getMaximumViewportHeight () const
 Gets the maximum viewport height.
 
unsigned int getMaximumViewportWidth () const
 Gets the maximum viewport width.
 
Multisample getMultisampleSupport () const
 Returns the support for multisample textures and renderbuffers.
 
GraphicsFormat getNativePixelReadFormat ()
 Gets the native pixel read format from the renderer.
 
Vector2 getPolygonDepthOffset () const
 Gets the polygon depth offset assigned to the renderer.
 
string getProgramBinary (unsigned int program, unsigned int &binaryFormat)
 Gets the binary representation for a GL shader program.
 
ProgramBinary getProgramBinarySupport () const
 Returns the support for program binaries.
 
ViewportRectangle getScissor () const
 Gets the current scissor rectangle from the renderer.
 
unsigned int getShaderSwitchCount () const
 Gets the number of shader switches from the renderer.
 
bool getState (RendererState state) const
 Returns the state of a specific renderer state.
 
void getStencilFunction (GraphicsCompareFunction *out_stencilCompareFunction, unsigned int *out_referenceValue, unsigned int *out_maskValue) const
 Gets a stencil function from the renderer.
 
void getStencilOperation (GraphicsStencilOperation *out_stencilFailOperation, GraphicsStencilOperation *out_stencilPassDepthFailOperation, GraphicsStencilOperation *out_stencilPassDepthPassOperation) const
 Gets a stencil operation from the renderer.
 
TexStorage getTexStorageSupport () const
 Returns the support for tex storage.
 
bool getTexStorageSupport (TextureType type, unsigned int samples) const
 Returns the support for tex storage.
 
unsigned int getTextureSwitchCount () const
 Gets the number of texture switches from the renderer.
 
uint64_t getTriangleCount () const
 Gets the triangle count from the renderer.
 
unsigned int getUniformArrayLength (const char *uniformName) const
 Returns the length of an array uniform.
 
int getUniformLocationSlow (const string &uniformName) const
 Finds uniform location for given uniform from active shader.
 
unsigned int getUniformSendCount () const
 Gets uniform sending count from the renderer.
 
uint64_t getVertexCount () const
 Gets the vertex count from the renderer.
 
ViewportRectangle getViewport () const
 Gets the current viewport rectangle from the renderer.
 
bool GPUCallsIsEnabled () const
 Returns whether GPU calls are enabled.
 
bool hasClearTarget (GraphicsClearTarget target) const
 Returns whether the renderer has a specific clear target.
 
void initialize (const RendererSettings &rendererSettings)
 Initializes the renderer object.
 
void invalidateAllocations ()
 Invalidates all handles from the renderer without affecting the GL state.
 
void invalidateFramebufferAttachments (FramebufferTarget target, bitset< Surface::APIAttachmentCount > attachments) const
 Invalidates framebuffer attachments.
 
bool isClearEnabled () const
 Returns whether any clear target is enabled.
 
bool isFramebufferComplete ()
 Returns whether the framebuffer status is complete.
 
bool isHalfFloatVertexAttributeSupported () const
 Returns whether half-float vertex attribute is supported.
 
bool isInitialized () const
 Returns whether the renderer is initialized.
 
bool isProgramBinaryFormatSupported (unsigned int glProgramBinaryFormat) const
 Returns whether a GL program binary format is supported.
 
bool isShaderBinaryFormatSupported (unsigned int glShaderBinaryFormat) const
 Returns whether a GL shader binary format is supported.
 
bool isSupported (RendererSupport feature) const
 Returns whether coverage buffer is supported.
 
bool isWorkaroundEnabled (Workaround workaround) const
 Return whether a workaround is enabled.
 
bool linkShaderProgram (unsigned int programHandle, kzString shaderName)
 Links a shader program with a given handle.
 
bool loadProgramFromCache (const ShaderProgram::CreateInfo &info, unsigned int program)
 Tries to load a shader program from the cache.
 
void logOpenGLInformation (unsigned int flags) const
 Logs information about renderer capabilities.
 
voidmapIndexBuffer (unsigned int size, BufferAccessMode mode)
 Maps index buffer.
 
voidmapVertexBuffer (unsigned int size, BufferAccessMode mode)
 Maps vertex or instance buffer.
 
void popStatistics ()
 
void pushStatistics ()
 
void readPixels (int x, int y, int width, int height, GraphicsFormat format, void *pixels)
 Reads the pixels from the current framebuffer.
 
void refreshRenderContext (bool geometryRendering)
 Refreshes the render context to contain all proper states.
 
void removeClearTarget (GraphicsClearTarget target)
 Removes a clearing target for the renderer.
 
void renderbufferStorage (GraphicsFormat format, unsigned int width, unsigned int height, unsigned int explicitSampleCount)
 Sets storage for the currently bound renderbuffer.
 
 Renderer ()
 Creates a renderer object.
 
void reset ()
 Resets the renderer.
 
void resetActiveFramebuffer ()
 Resets the active framebuffer for the renderer to the default (screen).
 
void resetClearTarget ()
 Resets the clear targets for the renderer.
 
void resetFrame ()
 Resets the frame for the core renderer, that is, counters for logging rendering information, such as triangle count.
 
void resolveMultisample (NativeFramebufferHandle sourceFramebuffer, NativeFramebufferHandle destinationFramebuffer, unsigned int srcOffsetX, unsigned int srcOffsetY, unsigned int srcWidth, unsigned int srcHeight, unsigned int dstOffsetX, unsigned int dstOffsetY, unsigned int dstWidth, unsigned int dstHeight)
 Resolves a multisample framebuffer.
 
void resolveMultisample (NativeFramebufferHandle sourceFramebuffer, NativeFramebufferHandle destinationFramebuffer, unsigned int srcOffsetX, unsigned int srcOffsetY, unsigned int srcWidth, unsigned int srcHeight, unsigned int dstOffsetX, unsigned int dstOffsetY, unsigned int dstWidth, unsigned int dstHeight, bool color, bool depth, bool stencil)
 Resolves a multisample framebuffer.
 
void resolveMultisample (Texture &src, Texture &dst, unsigned int offsetX, unsigned int offsetY, unsigned int width, unsigned int height)
 Resolves multisample samples from a source texture to a destination texture.
 
void resolveMultisample (Texture &src, Texture &dst, unsigned int offsetX, unsigned int offsetY, unsigned int width, unsigned int height, bool color, bool depth)
 Resolves multisample samples from a source texture to a destination texture.
 
void saveProgramToCache (const ShaderProgram::CreateInfo &info, unsigned int program)
 Saves a shader program to cache.
 
void setActiveFramebuffer (unsigned int frameBufferHandle)
 Sets the active framebuffer for the renderer.
 
void setActiveFramebufferCallback (FramebufferCallback callbackFunction)
 Sets the callback function that is called after setActiveFramebuffer.
 
void setActiveGLGraphicsOutput (GLGraphicsOutput *glGraphicsOutput)
 Sets the active surface context for the renderer.
 
void setActiveScalar (GraphicsScalar scalar, float value)
 Switches a scalar value for the renderer if necessary. For example, a depth clear value.
 
void setActiveShaderHandle (unsigned int activeShaderHandle, const int *vertexAttributeMap)
 Sets the active shader for the renderer.
 
void setActiveTextureUnit (unsigned int textureUnit)
 Sets the currently active texture unit.
 
void setBlendMode (int blendMode)
 Sets a blend mode for the renderer.
 
void setClearColor (ColorRGBA colorRGBA)
 Sets the clear color for the renderer.
 
void setClearDepthValue (float clearDepthValue)
 Sets clear depth for the renderer.
 
void setClearStencil (int stencilClearValue)
 Sets clear stencil for the renderer.
 
void setColorBufferCount (unsigned int colorBufferCount)
 Sets the number of draw color buffers for the currently active framebuffer.
 
void setColorWriteMode (GraphicsColorWriteMode colorWriteMode)
 Set a color write mode for the renderer.
 
void setCullMode (GraphicsCullMode cullMode)
 Sets a cull mode for the renderer.
 
void setDefaultFramebuffer (unsigned int frameBufferHandle)
 Sets the default framebuffer (screen) for the renderer.
 
void setDepthTest (GraphicsCompareFunction depthMode)
 Sets a depth pass mode for the renderer.
 
void setFillMode (GraphicsFillMode mode)
 Sets the polygon fill mode if supported by the backend.
 
void setGPUCallsEnabled (bool enabled)
 Sets GPU calls as enabled or disabled.
 
void setHasTessellationShader (bool hasTessellationShader)
 Sets whether the current program has an active tessellation shader, which requires overriding the primitive type to GL_PATCHES.
 
void setImageTargetTexture (TextureType type, void *imageObject)
 Sets an image object bound to the currently bound texture type.
 
void setIndexBuffer (unsigned int indexBuffer)
 Sets an index buffer for the renderer.
 
void setIndexBufferData (size_t dataSize, const void *data)
 Sets static index buffer data.
 
void setIndexBufferSubData (unsigned int offset, size_t size, const void *data)
 Uploads index buffer subdata with given offset and size.
 
void setIndexCount (unsigned int indexCount)
 Sets the index count for the renderer.
 
void setIndexData (void *indexData)
 Sets the index data for the renderer.
 
void setIndexData (void *indexData, IndexBufferType type)
 Sets the index data for the renderer.
 
void setInstanceCount (unsigned int instanceCount)
 Sets the instance count for the renderer.
 
void setLineWidth (float lineWidth)
 Sets the line width for the renderer.
 
void setLogging (bool enabled, bool dumpStateOnDrawCalls)
 Enables or disables the logging of OpenGL API calls.
 
void setMatrix (FixedMatrix matrixType, Matrix4x4 matrix)
 Sets a matrix for the renderer.
 
void setPixelStorePack (unsigned int packBytes)
 Sets pack row alignment in memory.
 
void setPixelStoreUnpack (unsigned int unpackBytes)
 Sets unpack row alignment in memory.
 
bool setPixelStoreUnpackRowLength (unsigned int rowLength)
 Sets the unpack row length.
 
void setPolygonDepthOffset (float derivativeMultiplier, float constantMultiplier)
 Sets the polygon depth offset for the renderer.
 
void setPolygonDepthOffset (Vector2 offset)
 Sets the polygon depth offset for the renderer.
 
void setPrimitiveType (GraphicsPrimitiveType prmitiveType)
 Sets the primitive type for the renderer.
 
void setScissorTest (optional< ViewportRectangle > scissor)
 Sets the scissor test state and optional rectangle for the renderer.
 
void setScreenSize (Vector2 screenSize)
 Sets the current screen size.
 
void setState (RendererState state, bool enable)
 Enables or disables the state of a specific renderer state.
 
void setStencilFunction (GraphicsCompareFunction stencilCompareFunction, unsigned int referenceValue, unsigned int maskValue)
 Sets a stencil function for the renderer.
 
void setStencilOperation (GraphicsStencilOperation stencilFailOperation, GraphicsStencilOperation stencilPassDepthFailOperation, GraphicsStencilOperation stencilPassDepthPassOperation)
 Sets a stencil operation for the renderer.
 
void setTextureAddressingMode (TextureType type, Sampler::AddressingMode texAddress)
 Sets the wrap mode for the currently bound texture in the current texture unit.
 
void setTextureCompare (TextureType type, bool isEnabled, GraphicsCompareFunction textureCompareFunction)
 Sets the texture comparison function for the currently bound texture in the current texture unit.
 
void setTextureFilter (TextureType type, Sampler::Filter minificationFilter, Sampler::Filter magnificationFilter, Sampler::MipmapMode mipmapMode, float anisotropy)
 Sets the texture filter for the currently bound texture in the current texture unit.
 
void setTextureImage2D (unsigned int glTextureImageTarget, unsigned int mipmapLevel, GraphicsFormat format, unsigned int width, unsigned int height, const void *data)
 Uploads texture data to the GPU.
 
void setTextureMaximumLevel (TextureType type, unsigned int maximumMipmapLevel)
 Sets the texture maximum mipmap level.
 
void setTextureSubImage2D (unsigned int glTextureImageTarget, unsigned int mipmapLevel, GraphicsFormat format, unsigned int x, unsigned int y, unsigned int width, unsigned int height, const void *data)
 Uploads texture subimage data to the GPU.
 
void setTextureSwizzleEachChannel (TextureType target, const TextureSwizzleMask &mask)
 Sets the texture swizzle mask for each channel separately.
 
void setTextureSwizzleMask (TextureType target, const TextureSwizzleMask &mask)
 Sets the texture swizzle mask for the color and alpha channels.
 
void setUniformColorArray (int uniformLocation, unsigned int count, const ColorRGBA *values)
 Sets a vector array with dimension to the renderer, using the currently bound shader.
 
void setUniformColorRGBA (const ColorRGBA &value, int uniformLocation)
 Sets a ColorRGBA uniform for the renderer, using the currently bound shader.
 
void setUniformFloat (const float &value, int uniformLocation)
 Sets a floating point uniform for the renderer, using the currently bound shader.
 
void setUniformFloatArray (int uniformLocation, unsigned int count, const float *values)
 Sets a float array with dimension to the renderer using the currently bound shader.
 
void setUniformIntArray (int uniformLocation, unsigned int count, const int *values)
 Sets an integer array with dimension to the renderer using the currently bound shader.
 
void setUniformInteger (const int &value, int uniformLocation)
 Sets an integer uniform for the renderer, using the currently bound shader.
 
void setUniformMatArray (int uniformLocation, unsigned int count, const Matrix3x3 *values)
 Sets a matrix array with dimension to the renderer, using the currently bound shader.
 
void setUniformMatArray (int uniformLocation, unsigned int count, const Matrix4x4 *values)
 Sets a matrix array with dimension to the renderer, using the currently bound shader.
 
void setUniformMatrix3x3 (const Matrix3x3 &value, int uniformLocation)
 Sets a Matrix3x3 uniform for the renderer, using the currently bound shader.
 
void setUniformMatrix4x4 (const Matrix4x4 &value, int uniformLocation)
 Sets a Matrix4x4 uniform for the renderer, using the currently bound shader.
 
void setUniformTexture (int uniformLocation, unsigned int textureUnit)
 Sets the uniform for a texture based on the currently active texture unit.
 
void setUniformVec2 (const Vector2 &value, int uniformLocation)
 Sets a Vector2 uniform for the renderer, using the currently bound shader.
 
void setUniformVec3 (const Vector3 &value, int uniformLocation)
 Sets a Vector3 uniform for the renderer, using the currently bound shader.
 
void setUniformVec4 (const Vector4 &value, int uniformLocation)
 Sets Vector4 uniform for the renderer, using the currently bound shader.
 
void setUniformVecArray (int uniformLocation, unsigned int count, const Vector2 *values)
 Sets a vector array with dimension to the renderer, using the currently bound shader.
 
void setUniformVecArray (int uniformLocation, unsigned int count, const Vector3 *values)
 Sets a vector array with dimension to the renderer, using the currently bound shader.
 
void setUniformVecArray (int uniformLocation, unsigned int count, const Vector4 *values)
 Sets a vector array with dimension to the renderer, using the currently bound shader.
 
void setVertexArrayData (VertexAttribute::Semantic attribute, const void *data)
 Sets vertex array data wrapper.
 
void setVertexArrayData (VertexAttribute::Semantic attribute, const void *data, unsigned int stride)
 Sets vertex array data wrapper.
 
void setVertexArrayData (VertexAttribute::Semantic attribute, GraphicsDataType dataType, const void *data)
 Sets vertex array data wrapper.
 
void setVertexArrayData (VertexAttribute::Semantic attribute, GraphicsDataType dataType, const void *data, unsigned int stride)
 Sets vertex array data.
 
void setVertexBuffer (unsigned int vertexBuffer)
 Sets a vertex or instance buffer for the renderer.
 
void setVertexBufferData (size_t dataSize, const void *data)
 Sets static vertex buffer data.
 
void setVertexBufferPointer (unsigned int location, int dimension, GraphicsDataType attributeDataType, int stride, const void *data)
 Sets the attribute data source for the currently enabled vertex attribute array.
 
void setVertexBufferPointer (unsigned int location, int dimension, GraphicsDataType attributeDataType, int stride, unsigned int divisor, const void *data)
 Sets the attribute data source for the currently enabled vertex attribute array.
 
void setVertexBufferSubData (unsigned int offset, size_t size, const void *data)
 Uploads vertex buffer subdata with given offset and size.
 
void setVertexCount (unsigned int vertexCount)
 Sets the vertex count for the renderer.
 
void setViewport (ViewportRectangle viewport)
 Sets an active viewport for the renderer.
 
void setWorkaroundEnable (Workaround workaround, bool enabled)
 Sets workaround enable state to true or false.
 
bool supports (GraphicsFormat format, unsigned int features) const
 Returns whether a graphics format supports given features.
 
bool supportsColorAttachment (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a color attachment in framebuffers.
 
bool supportsDepthStencilAttachment (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a depth-stencil attachment in framebuffers.
 
bool supportsRenderbuffer (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a renderbuffer.
 
bool supportsTexStorage (GraphicsFormat format, unsigned int features) const
 Returns whether a graphics format supports texture storage.
 
bool supportsTexture (GraphicsFormat format) const
 Returns whether the renderer can use a given graphics format as a texture.
 
void textureStorage (TextureType type, int sampleCount, int mipmapLevelCount, GraphicsFormat format, unsigned int width, unsigned int height, unsigned int depth, bool fixedSampleLocations)
 Specifies immutable texture format and shape.
 
void uninitialize ()
 Uninitializes the renderer object.
 
bool unmapIndexBuffer ()
 Unmaps index buffer.
 
bool unmapVertexBuffer ()
 Unmaps vertex or instance buffer.
 
void updateSettings (const RendererSettings &rendererSettings)
 Updates the renderer settings.
 
 ~Renderer ()
 

Static Public Member Functions

static ClearMode getClearMode (GraphicsFormat format)
 

Friends

RenderingChangeStateFlagoperator&= (RenderingChangeStateFlag &lhs, int rhs)
 And assignment operator for rendering change state flags.
 
RenderingChangeStateFlagoperator^= (RenderingChangeStateFlag &lhs, int rhs)
 Xor assignment operator for rendering change state flags.
 
RenderingChangeStateFlagoperator|= (RenderingChangeStateFlag &lhs, int rhs)
 Or assignment operator for rendering change state flags.
 

Member Typedef Documentation

◆ FramebufferCallback

typedef void(* kanzi::Renderer::FramebufferCallback) (unsigned int frameBufferHandle)

Callback prototype for setActiveFramebuffer.

Member Enumeration Documentation

◆ RenderingChangeStateFlag

Rendering change flag type.

Kanzi internally sets the bits to flag which rendering settings have changed.

Enumerator
RenderingChangeStateFlagNone 

No changes.

RenderingChangeStateFlagColorWriteMode 

Color write mode changed.

RenderingChangeStateFlagBlendMode 

Blend mode changed.

RenderingChangeStateFlagCullMode 

Cull mode changed.

RenderingChangeStateFlagDepthTest 

Depth mode changed.

RenderingChangeStateFlagAll 

Depth mode changed.

◆ Information

Enumerator
InformationGLVendor 
InformationGLRenderer 
InformationGLVersion 
InformationGLShadingLanguageVersion 
InformationGLExtensions 
InformationFormatSupport 
InformationShaderBinarySupport 
InformationProgramBinarySupport 
InformationFeatureSupport 
InformationImplementationDependent 
InformationDebug 
InformationAll 

◆ ClearMode

Per-color buffer clear setting.

Enumerator
ClearModeDisabled 

Does not clear the color buffer.

ClearModeUnsignedNormalized 

Clears the color buffer with an unsigned normalized color.

ClearModeUnsignedInteger 

Clears the color buffer with an unsigned integer value.

Note
Integer color buffers require OpenGL ES 3.
ClearModeSignedInteger 

Clears the color buffer with a signed integer value.

Note
Integer color buffers require OpenGL ES 3.
ClearModeFloat 

Clears the color buffer with a float value.

Note
Float color buffers require OpenGL ES 3.2 or the EXT_color_buffer_half_float extension.

◆ BufferAccessMode

Mode for accessing a GPU buffer.

Enumerator
ReadOnly 

Only reading from the buffer is allowed. Writing is forbidden.

WriteOnly 

Only writing to the buffer is allowed. Reading is forbidden.

ReadWrite 

Both reading and writing to the buffer are allowed.

◆ Workaround

Enumerator
WorkaroundTegra3ColorBufferHalfFloat 

Enables color buffer half float on Tegra 3.

WorkaroundAdreno330ColorBufferHalfFloat 

Enables color buffer half float on Adreno 330.

WorkaroundChromiumTextureImageUnitCount 

VirtualBox/Chromium incorrectly reports the number of image units.

WorkaroundAMDCompressedTexStorage 

Disables tex storage.

WorkaroundPVRVFrameOESEGLImageExternal 

Disables OES_EGL_image_external.

WorkaroundPVRVFrameDepth32f 

Disables 32f depth buffer format.

WorkaroundVivanteDepth32f 

Disables 32f depth buffer format.

WorkaroundFaultyRequiredInternalformat 

Disables GL_OES_required_internalformat when vendor is known to have drivers with related issues.

WorkaroundCount 

Constructor & Destructor Documentation

◆ Renderer()

kanzi::Renderer::Renderer ( )
explicit

Creates a renderer object.

◆ ~Renderer()

kanzi::Renderer::~Renderer ( )

Member Function Documentation

◆ resetFrame()

void kanzi::Renderer::resetFrame ( )

Resets the frame for the core renderer, that is, counters for logging rendering information, such as triangle count.

◆ reset()

void kanzi::Renderer::reset ( )

Resets the renderer.

Kanzi calls this function when the renderer is initialized. For example, this function resets the caches and states of the renderer, and syncs the renderer variables with the GL states.

This function is very slow. Instead of calling this function, use the Kanzi rendering functions whenever possible. If you do rendering without calling the Kanzi rendering functions, you can use this function to sync the Kanzi rendering state with the GPU state.

◆ initialize()

void kanzi::Renderer::initialize ( const RendererSettings & rendererSettings)

Initializes the renderer object.

Requires a graphics context.

Parameters
rendererSettingsSettings structure for initializing the renderer.

◆ updateSettings()

void kanzi::Renderer::updateSettings ( const RendererSettings & rendererSettings)

Updates the renderer settings.

After initialization, you can change only the shader binary cache settings.

Parameters
rendererSettingsThe settings structure to set to the renderer.
Since
Kanzi 3.9.8

◆ uninitialize()

void kanzi::Renderer::uninitialize ( )

Uninitializes the renderer object.

◆ isInitialized()

bool kanzi::Renderer::isInitialized ( ) const

Returns whether the renderer is initialized.

Returns
If the renderer is initialized, true, otherwise false.

◆ setActiveGLGraphicsOutput()

void kanzi::Renderer::setActiveGLGraphicsOutput ( GLGraphicsOutput * glGraphicsOutput)

Sets the active surface context for the renderer.

Parameters
glGraphicsOutputThe GL graphics output to use.

◆ getActiveGLGraphicsOutput()

GLGraphicsOutput * kanzi::Renderer::getActiveGLGraphicsOutput ( ) const

Gets the active surface context from the renderer.

Returns
The currently active GL graphics output.

◆ getActiveGraphicsContext()

KzsGlGraphicsContext * kanzi::Renderer::getActiveGraphicsContext ( ) const

◆ getActiveSurfaceClientAPI()

SurfaceClientAPI kanzi::Renderer::getActiveSurfaceClientAPI ( ) const

◆ getActiveColorSpace()

SurfaceColorSpace kanzi::Renderer::getActiveColorSpace ( ) const

Gets the active color space.

Returns
The currently active color space.

◆ getActiveSurfaceVendor()

::KzsOpenGlVendor kanzi::Renderer::getActiveSurfaceVendor ( ) const

◆ enableState()

void kanzi::Renderer::enableState ( RendererState state)

Enables a specific renderer state.

◆ disableState()

void kanzi::Renderer::disableState ( RendererState state)

Disables a specific renderer state.

◆ setState()

void kanzi::Renderer::setState ( RendererState state,
bool enable )

Enables or disables the state of a specific renderer state.

◆ getState()

bool kanzi::Renderer::getState ( RendererState state) const

Returns the state of a specific renderer state.

Parameters
stateThe state to query.
Returns
Whether the state is enabled.

◆ clear()

void kanzi::Renderer::clear ( )

Clears the currently bound framebuffer with requested buffers.

To request buffers to be cleared, use the addClearTarget() and addClearColor() functions.

◆ resetClearTarget()

void kanzi::Renderer::resetClearTarget ( )

Resets the clear targets for the renderer.

◆ addClearTarget()

void kanzi::Renderer::addClearTarget ( GraphicsClearTarget target)

Sets a clear target for the renderer.

Parameters
targetThe buffer to clear: kanzi::GraphicsClearTargetColor0, kanzi::GraphicsClearTargetDepth, or kanzi::GraphicsClearTargetStencil.
Note
To clear the color buffers 1..3 (GraphicsClearTargetColor1..3), use addClearColor().
See also
addClearColor()

◆ getClearMode()

static ClearMode kanzi::Renderer::getClearMode ( GraphicsFormat format)
static

◆ addClearColor() [1/5]

void kanzi::Renderer::addClearColor ( unsigned int drawBuffer,
uint32_t red,
uint32_t green,
uint32_t blue,
uint32_t alpha )

Registers color clear for an unsigned integer color buffer.

To perform all registered clears, call clear().

Note
OpenGL ES 3 is required for integer color buffers.
Parameters
drawBufferIndex of the color buffer to clear: 0..3.
redClear color red channel value.
greenClear color green channel value.
blueClear color blue channel value.
alphaClear color alpha channel value.
See also
clear()

◆ addClearColor() [2/5]

void kanzi::Renderer::addClearColor ( unsigned int drawBuffer,
int32_t red,
int32_t green,
int32_t blue,
int32_t alpha )

Registers color clear for a signed integer color buffer.

To perform all registered clears, call clear().

Note
OpenGL ES 3 is required for integer color buffers.
Parameters
drawBufferIndex of the color buffer to clear: 0..3.
redClear color red channel value.
greenClear color green channel value.
blueClear color blue channel value.
alphaClear color alpha channel value.
See also
clear()

◆ addClearColor() [3/5]

void kanzi::Renderer::addClearColor ( unsigned int drawBuffer,
float red,
float green,
float blue,
float alpha )

Registers color clear for a float color buffer.

To perform all registered clears, call clear().

Note
OpenGL ES 3.2 or EXT_color_buffer_half_float is required for float color buffers.
OpenGL ES 3.0 is required for drawBuffer > 0.
Parameters
drawBufferIndex of the color buffer to clear: 0..3 for OpenGL ES 3, 0 for OpenGL ES 2.
redClear color red channel value.
greenClear color green channel value.
blueClear color blue channel value.
alphaClear color alpha channel value.
See also
clear()

◆ addClearColor() [4/5]

void kanzi::Renderer::addClearColor ( unsigned int drawBuffer,
ColorRGBA colorRGBA )

Registers color clear for an unsigned normalized color buffer.

To perform all registered clears, call clear().

Note
OpenGL ES 3.0 is required for drawBuffer > 0.
Parameters
drawBufferIndex of the color buffer to clear: 0..3 for OpenGL ES 3, 0 for OpenGL ES 2.
colorRGBARGBA clear color.
See also
clear()

◆ addClearColor() [5/5]

void kanzi::Renderer::addClearColor ( unsigned int drawBuffer,
ClearMode clearMode )

Registers color clear with value 0.

To perform all registered clears, call clear().

Note
OpenGL ES 3.0 is required for drawBuffer > 0.
Parameters
drawBufferIndex of the color buffer to clear: 0..3 for OpenGL ES 3, 0 for OpenGL ES 2.
clearModeRenderer::ClearMode of the color buffer.
See also
clear()

◆ removeClearTarget()

void kanzi::Renderer::removeClearTarget ( GraphicsClearTarget target)

Removes a clearing target for the renderer.

Parameters
targetThe clear target to remove.

◆ hasClearTarget()

bool kanzi::Renderer::hasClearTarget ( GraphicsClearTarget target) const

Returns whether the renderer has a specific clear target.

Parameters
targetThe clear target to query.
Returns
If the clear target is enabled, true, otherwise false.

◆ isClearEnabled()

bool kanzi::Renderer::isClearEnabled ( ) const

Returns whether any clear target is enabled.

Returns
If any clear target is enabled, true, otherwise false.

◆ setClearColor()

void kanzi::Renderer::setClearColor ( ColorRGBA colorRGBA)

Sets the clear color for the renderer.

◆ setColorWriteMode()

void kanzi::Renderer::setColorWriteMode ( GraphicsColorWriteMode colorWriteMode)

Set a color write mode for the renderer.

◆ getColorWriteMode()

GraphicsColorWriteMode kanzi::Renderer::getColorWriteMode ( ) const

Gets the current color write mode from the renderer.

◆ setScissorTest()

void kanzi::Renderer::setScissorTest ( optional< ViewportRectangle > scissor)

Sets the scissor test state and optional rectangle for the renderer.

◆ setClearDepthValue()

void kanzi::Renderer::setClearDepthValue ( float clearDepthValue)

Sets clear depth for the renderer.

◆ setClearStencil()

void kanzi::Renderer::setClearStencil ( int stencilClearValue)

Sets clear stencil for the renderer.

◆ setViewport()

void kanzi::Renderer::setViewport ( ViewportRectangle viewport)

Sets an active viewport for the renderer.

◆ setVertexBuffer()

void kanzi::Renderer::setVertexBuffer ( unsigned int vertexBuffer)

Sets a vertex or instance buffer for the renderer.

◆ setIndexBuffer()

void kanzi::Renderer::setIndexBuffer ( unsigned int indexBuffer)

Sets an index buffer for the renderer.

◆ drawBuffers()

void kanzi::Renderer::drawBuffers ( )

Renders the buffers that are currently bound.

◆ setVertexCount()

void kanzi::Renderer::setVertexCount ( unsigned int vertexCount)

Sets the vertex count for the renderer.

Since
Kanzi 3.9.7 changed the parameter type to unsigned int.

◆ setIndexCount()

void kanzi::Renderer::setIndexCount ( unsigned int indexCount)

Sets the index count for the renderer.

◆ setIndexData() [1/2]

void kanzi::Renderer::setIndexData ( void * indexData)

Sets the index data for the renderer.

◆ setIndexData() [2/2]

void kanzi::Renderer::setIndexData ( void * indexData,
IndexBufferType type )

Sets the index data for the renderer.

◆ setPrimitiveType()

void kanzi::Renderer::setPrimitiveType ( GraphicsPrimitiveType prmitiveType)

Sets the primitive type for the renderer.

◆ setInstanceCount()

void kanzi::Renderer::setInstanceCount ( unsigned int instanceCount)

Sets the instance count for the renderer.

Since
Kanzi 3.9.6
Kanzi 3.9.7 changed the parameter type to unsigned int.

◆ getUniformLocationSlow()

int kanzi::Renderer::getUniformLocationSlow ( const string & uniformName) const

Finds uniform location for given uniform from active shader.

Kanzi stores the data in the uniform cache and fetches the data from the cache in subsequent calls.

Note
Comparing strings is expensive, so avoid calling this function.

◆ getUniformArrayLength()

unsigned int kanzi::Renderer::getUniformArrayLength ( const char * uniformName) const

Returns the length of an array uniform.

Returns
The length of the array uniform. If the uniform does not exist, returns 0. If the uniform is not an array, returns 1.

◆ setUniformIntArray()

void kanzi::Renderer::setUniformIntArray ( int uniformLocation,
unsigned int count,
const int * values )

Sets an integer array with dimension to the renderer using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformFloatArray()

void kanzi::Renderer::setUniformFloatArray ( int uniformLocation,
unsigned int count,
const float * values )

Sets a float array with dimension to the renderer using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformVecArray() [1/3]

void kanzi::Renderer::setUniformVecArray ( int uniformLocation,
unsigned int count,
const Vector2 * values )

Sets a vector array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformVecArray() [2/3]

void kanzi::Renderer::setUniformVecArray ( int uniformLocation,
unsigned int count,
const Vector3 * values )

Sets a vector array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformVecArray() [3/3]

void kanzi::Renderer::setUniformVecArray ( int uniformLocation,
unsigned int count,
const Vector4 * values )

Sets a vector array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformColorArray()

void kanzi::Renderer::setUniformColorArray ( int uniformLocation,
unsigned int count,
const ColorRGBA * values )

Sets a vector array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformMatArray() [1/2]

void kanzi::Renderer::setUniformMatArray ( int uniformLocation,
unsigned int count,
const Matrix3x3 * values )

Sets a matrix array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformMatArray() [2/2]

void kanzi::Renderer::setUniformMatArray ( int uniformLocation,
unsigned int count,
const Matrix4x4 * values )

Sets a matrix array with dimension to the renderer, using the currently bound shader.

Parameters
uniformLocationUniform location ID.
countNumber of entries to set.
valuesValues to set.

◆ setUniformInteger()

void kanzi::Renderer::setUniformInteger ( const int & value,
int uniformLocation )
inline

Sets an integer uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformFloat()

void kanzi::Renderer::setUniformFloat ( const float & value,
int uniformLocation )
inline

Sets a floating point uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformVec2()

void kanzi::Renderer::setUniformVec2 ( const Vector2 & value,
int uniformLocation )
inline

Sets a Vector2 uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformVec3()

void kanzi::Renderer::setUniformVec3 ( const Vector3 & value,
int uniformLocation )
inline

Sets a Vector3 uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformVec4()

void kanzi::Renderer::setUniformVec4 ( const Vector4 & value,
int uniformLocation )
inline

Sets Vector4 uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformColorRGBA()

void kanzi::Renderer::setUniformColorRGBA ( const ColorRGBA & value,
int uniformLocation )
inline

Sets a ColorRGBA uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformMatrix3x3()

void kanzi::Renderer::setUniformMatrix3x3 ( const Matrix3x3 & value,
int uniformLocation )
inline

Sets a Matrix3x3 uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setUniformMatrix4x4()

void kanzi::Renderer::setUniformMatrix4x4 ( const Matrix4x4 & value,
int uniformLocation )
inline

Sets a Matrix4x4 uniform for the renderer, using the currently bound shader.

Parameters
valueValue to set.
uniformLocationUniform location ID.

◆ setActiveScalar()

void kanzi::Renderer::setActiveScalar ( GraphicsScalar scalar,
float value )

Switches a scalar value for the renderer if necessary. For example, a depth clear value.

◆ getActiveScalar()

float kanzi::Renderer::getActiveScalar ( GraphicsScalar scalar) const

Returns a current scalar value from the renderer.

Returns
The current scalar value.

◆ setBlendMode()

void kanzi::Renderer::setBlendMode ( int blendMode)

Sets a blend mode for the renderer.

Since
Kanzi 3.9.1 data type of blendMode parameter changed from GraphicsBlendMode to int.

◆ getBlendMode()

int kanzi::Renderer::getBlendMode ( ) const

Gets the blend mode from the renderer.

Since
Kanzi 3.9.1 data type of blendMode parameter changed from GraphicsBlendMode to int.

◆ setCullMode()

void kanzi::Renderer::setCullMode ( GraphicsCullMode cullMode)

Sets a cull mode for the renderer.

◆ getCullMode()

GraphicsCullMode kanzi::Renderer::getCullMode ( ) const

Gets the cull mode from the renderer.

◆ setDepthTest()

void kanzi::Renderer::setDepthTest ( GraphicsCompareFunction depthMode)

Sets a depth pass mode for the renderer.

◆ getDepthTest()

GraphicsCompareFunction kanzi::Renderer::getDepthTest ( ) const

Gets the depth pass mode from the renderer.

◆ setStencilFunction()

void kanzi::Renderer::setStencilFunction ( GraphicsCompareFunction stencilCompareFunction,
unsigned int referenceValue,
unsigned int maskValue )

Sets a stencil function for the renderer.

◆ setStencilOperation()

void kanzi::Renderer::setStencilOperation ( GraphicsStencilOperation stencilFailOperation,
GraphicsStencilOperation stencilPassDepthFailOperation,
GraphicsStencilOperation stencilPassDepthPassOperation )

Sets a stencil operation for the renderer.

◆ getStencilFunction()

void kanzi::Renderer::getStencilFunction ( GraphicsCompareFunction * out_stencilCompareFunction,
unsigned int * out_referenceValue,
unsigned int * out_maskValue ) const

Gets a stencil function from the renderer.

◆ getStencilOperation()

void kanzi::Renderer::getStencilOperation ( GraphicsStencilOperation * out_stencilFailOperation,
GraphicsStencilOperation * out_stencilPassDepthFailOperation,
GraphicsStencilOperation * out_stencilPassDepthPassOperation ) const

Gets a stencil operation from the renderer.

◆ setMatrix()

void kanzi::Renderer::setMatrix ( FixedMatrix matrixType,
Matrix4x4 matrix )

Sets a matrix for the renderer.

◆ getMatrix()

Matrix4x4 kanzi::Renderer::getMatrix ( FixedMatrix matrixType) const

Gets a matrix from the renderer.

◆ calculateProjectionCameraWorldMatrix()

void kanzi::Renderer::calculateProjectionCameraWorldMatrix ( )

Calculates the projection * camera * world matrix.

This matrix transforms a point or matrix from local space to screen space.

◆ applyFixedUniformTime()

void kanzi::Renderer::applyFixedUniformTime ( int uniformLocation)

Applies the Time fixed uniform.

Parameters
uniformLocationUniform location.

◆ applyFixedUniformWindowSize()

void kanzi::Renderer::applyFixedUniformWindowSize ( int uniformLocation)

Applies the WindowSize fixed uniform.

Parameters
uniformLocationUniform location.

◆ applyTransformationUniform()

void kanzi::Renderer::applyTransformationUniform ( ShaderProgram::FixedUniform uniform,
int uniformLocation )

Applies a single transformation uniform.

Repeatedly called by applyTransformation().

Parameters
uniformUniform type.
uniformLocationUniform location.

◆ applyTransformation()

void kanzi::Renderer::applyTransformation ( ShaderProgram & shaderProgram)

Applies transformations from the renderer to the GPU.

Parameters
shaderProgramShader program in use.

◆ applyTextureSizeUniforms()

void kanzi::Renderer::applyTextureSizeUniforms ( ShaderTextureUniform textureUniforms,
unsigned int textureWidth,
unsigned int textureHeight )

Applies texture uniforms for the renderer.

◆ applyTexture()

void kanzi::Renderer::applyTexture ( TextureType type,
unsigned int textureUnit,
unsigned int handle )

Sets texture settings for a given texture unit.

This only changes the renderer state and does not issue GL calls. For the changes to take effect, you must refresh the texture unit state.

Parameters
typeType of the texture (texture target) to set.
textureUnitTexture unit to set.
handleNative texture handle.

◆ detachTexture()

void kanzi::Renderer::detachTexture ( unsigned int textureUnit)

Detaches all texture information from a given texture unit.

This only changes the renderer state and does not issue GL calls. For the changes to take effect, you must refresh the texture unit state.

Parameters
textureUnitTexture unit to set.

◆ setActiveTextureUnit()

void kanzi::Renderer::setActiveTextureUnit ( unsigned int textureUnit)

Sets the currently active texture unit.

Takes effect immediately. You can call this function manually. Kanzi also calls this function internally to refresh the render context of a texture unit.

Parameters
textureUnitTexture unit to activate.

◆ setUniformTexture()

void kanzi::Renderer::setUniformTexture ( int uniformLocation,
unsigned int textureUnit )

Sets the uniform for a texture based on the currently active texture unit.

This is essentially an alias for setting an integer uniform.

Parameters
uniformLocationUniform location to apply.
textureUnitTexture unit for this uniform.

◆ bindTexture()

unsigned int kanzi::Renderer::bindTexture ( TextureType type,
unsigned int handle )

Binds specified texture of specified type to the currently active texture unit.

Takes effect immediately, and as a consequence, does not flag the texture unit render context dirty.

Parameters
typeType of texture to bind.
handleNative texture handle.
Returns
Previous texture handle bound to current texture unit for this texture type.

◆ generateTexture()

unsigned int kanzi::Renderer::generateTexture ( )

Generates a new texture for the renderer.

◆ setTextureImage2D()

void kanzi::Renderer::setTextureImage2D ( unsigned int glTextureImageTarget,
unsigned int mipmapLevel,
GraphicsFormat format,
unsigned int width,
unsigned int height,
const void * data )

Uploads texture data to the GPU.

◆ setTextureSubImage2D()

void kanzi::Renderer::setTextureSubImage2D ( unsigned int glTextureImageTarget,
unsigned int mipmapLevel,
GraphicsFormat format,
unsigned int x,
unsigned int y,
unsigned int width,
unsigned int height,
const void * data )

Uploads texture subimage data to the GPU.

◆ textureStorage()

void kanzi::Renderer::textureStorage ( TextureType type,
int sampleCount,
int mipmapLevelCount,
GraphicsFormat format,
unsigned int width,
unsigned int height,
unsigned int depth,
bool fixedSampleLocations )

Specifies immutable texture format and shape.

◆ generateMipmaps()

void kanzi::Renderer::generateMipmaps ( TextureType textureType)

Generates mipmaps for the currently bound texture.

◆ deleteTexture()

void kanzi::Renderer::deleteTexture ( unsigned int textureHandle)

Deletes a texture through the renderer.

◆ setTextureAddressingMode()

void kanzi::Renderer::setTextureAddressingMode ( TextureType type,
Sampler::AddressingMode texAddress )

Sets the wrap mode for the currently bound texture in the current texture unit.

◆ setTextureFilter()

void kanzi::Renderer::setTextureFilter ( TextureType type,
Sampler::Filter minificationFilter,
Sampler::Filter magnificationFilter,
Sampler::MipmapMode mipmapMode,
float anisotropy )

Sets the texture filter for the currently bound texture in the current texture unit.

Parameters
typeThe type of the texture to edit.
minificationFilterMinification filter for the texture.
magnificationFilterMagnification filter for the texture.
mipmapModeMipmap mode for the texture.
anisotropyAnisotropic filtering level for the texture. To disable the feature, set to a value <= 1.0f.

◆ setTextureSwizzleMask()

void kanzi::Renderer::setTextureSwizzleMask ( TextureType target,
const TextureSwizzleMask & mask )

Sets the texture swizzle mask for the color and alpha channels.

You can use this method if the native OpenGL driver supports the GL_ARB_texture_swizzle or GL_EXT_texture_swizzle extension.

Parameters
targetTarget texture type.
maskSwizzle mask for the texture. This can be either a custom swizzle mask or one of these predefined ones: SwizzleMaskRGBToLuminanceAlpha, SwizzleMaskLuminanceToRGBA, and SwizzleMaskARGBToRGBA.
See also
setTextureSwizzleEachChannel()

◆ setTextureSwizzleEachChannel()

void kanzi::Renderer::setTextureSwizzleEachChannel ( TextureType target,
const TextureSwizzleMask & mask )

Sets the texture swizzle mask for each channel separately.

You can use this method if the native OpenGL driver supports the GL_TEXTURE_SWIZZLE_R, GL_TEXTURE_SWIZZLE_G, GL_TEXTURE_SWIZZLE_B, and GL_TEXTURE_SWIZZLE_A texture parameters.

Parameters
targetTarget texture type.
maskSwizzle mask for the texture. This can be a custom swizzle mask or one of these predefined ones: SwizzleMaskRGBToLuminanceAlpha, SwizzleMaskLuminanceToRGBA and SwizzleMaskARGBToRGBA.
See also
setTextureSwizzleMask()
Since
Kanzi 3.9.6

◆ setTextureCompare()

void kanzi::Renderer::setTextureCompare ( TextureType type,
bool isEnabled,
GraphicsCompareFunction textureCompareFunction )

Sets the texture comparison function for the currently bound texture in the current texture unit.

Parameters
typeThe type of the texture to edit.
isEnabledWhether to enable the depth comparison mode for the texture. To disable depth comparison, set to false.
textureCompareFunctionThe texture comparison function to use.

◆ setTextureMaximumLevel()

void kanzi::Renderer::setTextureMaximumLevel ( TextureType type,
unsigned int maximumMipmapLevel )

Sets the texture maximum mipmap level.

Parameters
typeThe type of the texture to edit.
maximumMipmapLevelThe maximum level Kanzi uses when mipmapping during rendering.
Since
Kanzi 3.9.10

◆ setPixelStorePack()

void kanzi::Renderer::setPixelStorePack ( unsigned int packBytes)

Sets pack row alignment in memory.

Default value is 4.

Parameters
packBytesValue for byte alignment.

◆ setPixelStoreUnpack()

void kanzi::Renderer::setPixelStoreUnpack ( unsigned int unpackBytes)

Sets unpack row alignment in memory.

Default value is 4.

Parameters
unpackBytesValue for byte alignment.

◆ setPixelStoreUnpackRowLength()

bool kanzi::Renderer::setPixelStoreUnpackRowLength ( unsigned int rowLength)

Sets the unpack row length.

If nonzero, specifies the number of bytes per row of image data. Use when image data rows are not aligned exactly at bytes per pixel multiplied by image width. Default value is 0.

Parameters
rowLengthNumber of bytes per image row.
Returns
If the target device supports the feature and it is possible to set the row length, true, otherwise false.

◆ createShader()

unsigned int kanzi::Renderer::createShader ( ShaderType type)

Creates a shader.

◆ createShaderProgram()

unsigned int kanzi::Renderer::createShaderProgram ( )

Creates a shader program. Returns the handle to the program.

◆ refreshRenderContext()

void kanzi::Renderer::refreshRenderContext ( bool geometryRendering)

Refreshes the render context to contain all proper states.

◆ attachShaderToProgram()

void kanzi::Renderer::attachShaderToProgram ( unsigned int programHandle,
unsigned int shaderHandle )

Attaches a shader to a program.

◆ detachShaderFromProgram()

void kanzi::Renderer::detachShaderFromProgram ( unsigned int programHandle,
unsigned int shaderHandle )

Detaches a shader from a program.

◆ bindAttributeToLocation()

void kanzi::Renderer::bindAttributeToLocation ( unsigned int programHandle,
unsigned int locationIndex,
kzString attributeName )

Binds an attribute to a given location index. For example, binds "kzPosition" to 0.

◆ linkShaderProgram()

bool kanzi::Renderer::linkShaderProgram ( unsigned int programHandle,
kzString shaderName )

Links a shader program with a given handle.

◆ compileSourceShader()

bool kanzi::Renderer::compileSourceShader ( ShaderType shaderType,
unsigned int shaderHandle,
const char *const shaderCode,
string_view shaderName )

Compiles a source shader and deploys it to the GPU.

◆ deployBinaryShader()

bool kanzi::Renderer::deployBinaryShader ( unsigned int count,
const unsigned int * shaders,
unsigned int binaryFormat,
const void * data,
size_t dataSize )

Deploys a binary shader.

Returns
If the graphics driver accepts the binary shader, true, otherwise false.

◆ deployBinaryProgram()

bool kanzi::Renderer::deployBinaryProgram ( unsigned int program,
unsigned int binaryFormat,
const void * data,
size_t dataSize )

Initializes shader program from program binary data.

Program binaries are specific to vendor, device, and driver. If deployBinaryProgram() succeeds, the program is in linked state. If deployBinaryProgram() fails, the program remains in the previous state.

To check whether a specific program binary format is supported by a graphics device, use isProgramBinaryFormatSupported.

To query back the program binary of a previously linked GL shader program from the graphics device, use getProgramBinary.

Parameters
programGL shader program name to initialize from program binary data.
binaryFormatBinary format for data.
dataProgram binary data.
dataSizeNumber of bytes in data.
Returns
If the shader program is successfully initialized from program binary data, true, otherwise false.

◆ getProgramBinary()

string kanzi::Renderer::getProgramBinary ( unsigned int program,
unsigned int & binaryFormat )

Gets the binary representation for a GL shader program.

Program binaries are specific to vendor, device, and driver.

Parameters
programThe name of the GL shader program for which you want to get program binary.
binaryFormatGL program binary format will be returned here, or KZS_GL_NONE if no program binary format was supported by graphics device.
Returns
The program binary data. If the graphics device does not support any program binary format, the size of the data is 0.
See also
isProgramBinaryFormatSupported, deployBinaryProgram

◆ deleteShaderProgram()

void kanzi::Renderer::deleteShaderProgram ( unsigned int programHandle)

Deletes a shader program and the attached shaders.

◆ deleteShader()

void kanzi::Renderer::deleteShader ( unsigned int shaderHandle)

Deletes a shader.

◆ generateFramebuffer()

unsigned int kanzi::Renderer::generateFramebuffer ( )

Generates new texture for the renderer.

◆ deleteFramebuffer()

void kanzi::Renderer::deleteFramebuffer ( unsigned int frameBufferHandle)

Deletes a framebuffer.

◆ bindFramebuffer()

void kanzi::Renderer::bindFramebuffer ( unsigned int frameBufferHandle)

Binds a framebuffer.

◆ isFramebufferComplete()

bool kanzi::Renderer::isFramebufferComplete ( )

Returns whether the framebuffer status is complete.

If the framebuffer status is not complete, logs an error code.

Note
Detailed error condition is available only in debug builds.
Avoid calling isFramebufferComplete() in release builds, as this can cause the graphics driver to slow down.
Returns
If the status is framebuffer complete, true, otherwise false.

◆ invalidateFramebufferAttachments()

void kanzi::Renderer::invalidateFramebufferAttachments ( FramebufferTarget target,
bitset< Surface::APIAttachmentCount > attachments ) const

Invalidates framebuffer attachments.

After invalidation, the contents of specified attachments are undefined. The graphics driver can perform performance and memory optimizations when it knows that the contents of specific attachments are no longer needed.

Parameters
targetFramebuffer target to invalidate.
attachmentsBits from Framebuffer::AttachmentBit to specify the attachments to invalidate. This function invalidates the surfaces that are attached to these attachment points.

◆ framebufferTexture2D()

void kanzi::Renderer::framebufferTexture2D ( unsigned int glTextureImageTarget,
Surface::APIAttachment attachment,
unsigned int textureHandle,
unsigned int mipmapLevel,
unsigned int implicitSampleCount )

Attaches a texture to the currently active framebuffer.

Parameters
glTextureImageTargetGL texture image target. For a cubemap texture, this specifies the cubemap face.
attachmentFramebuffer attachment point to which you want to attach the texture.
textureHandleGL texture object name to attach.
mipmapLevelMipmap level of the texture to attach.
implicitSampleCountSets the number of samples for implicit multisampling. To not use implicit multisampling, set to 0.

◆ framebufferRenderbuffer()

void kanzi::Renderer::framebufferRenderbuffer ( Surface::APIAttachment attachment,
unsigned int renderbuffer )

Attaches a renderbuffer to the currently active framebuffer.

Parameters
attachmentFramebuffer attachment point to which you want to attach the renderbuffer.
renderbufferGL renderbuffer object name to attach.

◆ generateRenderbuffer()

unsigned int kanzi::Renderer::generateRenderbuffer ( )

Generates a texture for the renderer.

Returns
The allocated GL renderbuffer object name.

◆ deleteRenderbuffer()

void kanzi::Renderer::deleteRenderbuffer ( unsigned int renderbuffer)

Deletes a renderbuffer.

Parameters
renderbufferThe GL renderbuffer object name to delete.

◆ bindRenderbuffer()

void kanzi::Renderer::bindRenderbuffer ( unsigned int renderbuffer)

Binds a renderbuffer for editing.

Parameters
renderbufferThe GL renderbuffer object name to bind.

◆ renderbufferStorage()

void kanzi::Renderer::renderbufferStorage ( GraphicsFormat format,
unsigned int width,
unsigned int height,
unsigned int explicitSampleCount )

Sets storage for the currently bound renderbuffer.

Parameters
formatGraphicsFormat for the renderbuffer.
widthWidth for the renderbuffer in pixels.
heightHeight for the renderbuffer in pixels.
explicitSampleCountNumber of multisample samples.

◆ generateBuffer()

unsigned int kanzi::Renderer::generateBuffer ( )

Generates new index or vertex buffer or uniform buffer object name.

◆ setVertexBufferData()

void kanzi::Renderer::setVertexBufferData ( size_t dataSize,
const void * data )

Sets static vertex buffer data.

◆ setIndexBufferData()

void kanzi::Renderer::setIndexBufferData ( size_t dataSize,
const void * data )

Sets static index buffer data.

◆ setVertexBufferSubData()

void kanzi::Renderer::setVertexBufferSubData ( unsigned int offset,
size_t size,
const void * data )

Uploads vertex buffer subdata with given offset and size.

◆ setIndexBufferSubData()

void kanzi::Renderer::setIndexBufferSubData ( unsigned int offset,
size_t size,
const void * data )

Uploads index buffer subdata with given offset and size.

◆ deleteBuffer()

void kanzi::Renderer::deleteBuffer ( unsigned int handle)

Deletes vertex, index, or instance buffer.

◆ mapVertexBuffer()

void * kanzi::Renderer::mapVertexBuffer ( unsigned int size,
BufferAccessMode mode )

Maps vertex or instance buffer.

Parameters
sizeSize in bytes of the mapped area of the buffer.
modeBuffer access mode, which can be read, write, or both.

◆ unmapVertexBuffer()

bool kanzi::Renderer::unmapVertexBuffer ( )

Unmaps vertex or instance buffer.

Returns
If the unmapping succeeds, true, otherwise false.

◆ mapIndexBuffer()

void * kanzi::Renderer::mapIndexBuffer ( unsigned int size,
BufferAccessMode mode )

Maps index buffer.

Parameters
sizeSize in bytes of the mapped area of the buffer.
modeBuffer access mode, which can be read, write, or both.

◆ unmapIndexBuffer()

bool kanzi::Renderer::unmapIndexBuffer ( )

Unmaps index buffer.

Returns
Indicates whether the unmapping failed.

◆ enableVertexAttributeArray()

void kanzi::Renderer::enableVertexAttributeArray ( unsigned int attributeHandle)

Sets vertex attribute array to be enabled.

Deprecated
Implicitly handled by beginVertexArray() and setVertexBufferPointer().
Parameters
attributeHandleIndex to the attribute to enable.

◆ disableVertexAttributeArray()

void kanzi::Renderer::disableVertexAttributeArray ( unsigned int attributeHandle)

Sets vertex attribute array to be disabled.

Deprecated
Implicitly handled by beginVertexArray() and setVertexBufferPointer().
Parameters
attributeHandleIndex to the attribute to disable.

◆ applyVertexAttributeArrays()

void kanzi::Renderer::applyVertexAttributeArrays ( )

Updates vertex attribute configurations to the graphics driver.

If you change the vertex attribute configuration with enableVertexAttributeArray(), disableVertexAttributeArray(), or setVertexBufferPointer(), call this function before each draw call.

◆ setVertexBufferPointer() [1/2]

void kanzi::Renderer::setVertexBufferPointer ( unsigned int location,
int dimension,
GraphicsDataType attributeDataType,
int stride,
const void * data )
inline

Sets the attribute data source for the currently enabled vertex attribute array.

Note
Kanzi sources the attribute data from the vertex buffer (GPU memory) that is current at the time of the function call. If the current vertex buffer is zero, Kanzi sources the attribute data from CPU memory. In OpenGL, this is known as "client side data".
Parameters
locationAttribute location.
dimensionNumber of vector components in the attribute. Valid values are 1, 2, 3, and 4.
attributeDataTypeData type of the attribute.
strideStride, that is, the number of bytes to get from one vertex to the next vertex. Valid values are positive integers.
dataIf the current vertex buffer is non-zero, this is the offset in bytes to the current vertex buffer GPU memory. If the current vertex buffer is zero, this is the CPU memory address to the attribute data.

◆ setVertexBufferPointer() [2/2]

void kanzi::Renderer::setVertexBufferPointer ( unsigned int location,
int dimension,
GraphicsDataType attributeDataType,
int stride,
unsigned int divisor,
const void * data )

Sets the attribute data source for the currently enabled vertex attribute array.

Note
Kanzi sources the attribute data from the vertex buffer (GPU memory) that is current at the time of the function call. If the current vertex buffer is zero, Kanzi sources the attribute data from CPU memory. In OpenGL, this is known as "client side data".
Parameters
locationAttribute location.
dimensionNumber of vector components in the attribute. Valid values are 1, 2, 3, and 4.
attributeDataTypeData type of the attribute.
strideStride, that is, the number of bytes to get from one vertex to the next vertex. Valid values are positive integers.
divisorAttribute rate divisor: zero for vertex attributes, 1+ for instance attributes.
dataIf current vertex buffer is non-zero, this is the offset in bytes to the current vertex buffer GPU memory. If the current vertex buffer is zero, this is the CPU memory address to the attribute data.
Since
Kanzi 3.9.6

◆ setActiveShaderHandle()

void kanzi::Renderer::setActiveShaderHandle ( unsigned int activeShaderHandle,
const int * vertexAttributeMap )

Sets the active shader for the renderer.

◆ getActiveShaderHandle()

unsigned int kanzi::Renderer::getActiveShaderHandle ( ) const

Gets the active shader handle from the renderer.

◆ getActiveShaderAttributeMap()

const int * kanzi::Renderer::getActiveShaderAttributeMap ( ) const

Gets the active vertex attribute map from the renderer.

◆ setDefaultFramebuffer()

void kanzi::Renderer::setDefaultFramebuffer ( unsigned int frameBufferHandle)

Sets the default framebuffer (screen) for the renderer.

◆ setActiveFramebuffer()

void kanzi::Renderer::setActiveFramebuffer ( unsigned int frameBufferHandle)

Sets the active framebuffer for the renderer.

Parameters
frameBufferHandleHandle to bind for rendering.

◆ setColorBufferCount()

void kanzi::Renderer::setColorBufferCount ( unsigned int colorBufferCount)

Sets the number of draw color buffers for the currently active framebuffer.

Note
For multiple draw color buffers, OpenGL ES 3 is required.
Parameters
colorBufferCountNumber of color attachments.

◆ resetActiveFramebuffer()

void kanzi::Renderer::resetActiveFramebuffer ( )

Resets the active framebuffer for the renderer to the default (screen).

◆ setActiveFramebufferCallback()

void kanzi::Renderer::setActiveFramebufferCallback ( FramebufferCallback callbackFunction)

Sets the callback function that is called after setActiveFramebuffer.

◆ getActiveFramebuffer()

unsigned int kanzi::Renderer::getActiveFramebuffer ( ) const

Gets the active framebuffer handle from the renderer.

◆ readPixels()

void kanzi::Renderer::readPixels ( int x,
int y,
int width,
int height,
GraphicsFormat format,
void * pixels )

Reads the pixels from the current framebuffer.

◆ getNativePixelReadFormat()

GraphicsFormat kanzi::Renderer::getNativePixelReadFormat ( )

Gets the native pixel read format from the renderer.

◆ beginMaterialSetup()

void kanzi::Renderer::beginMaterialSetup ( )

Begins a material for the renderer.

◆ endMaterialSetup()

void kanzi::Renderer::endMaterialSetup ( )

Ends a material for the renderer.

◆ beginVertexArray()

void kanzi::Renderer::beginVertexArray ( )

Begins a set of vertex arrays.

◆ setVertexArrayData() [1/4]

void kanzi::Renderer::setVertexArrayData ( VertexAttribute::Semantic attribute,
GraphicsDataType dataType,
const void * data,
unsigned int stride )

Sets vertex array data.

Value 0u for stride means that the elements are tightly packed.

Parameters
attributeSemantic attribute.
dataTypeVertex data type.
dataVertex data pointer.
strideVertex stride in bytes.

◆ setVertexArrayData() [2/4]

void kanzi::Renderer::setVertexArrayData ( VertexAttribute::Semantic attribute,
GraphicsDataType dataType,
const void * data )
inline

Sets vertex array data wrapper.

Stride defaults to 0u.

Parameters
attributeSemantic attribute.
dataTypeVertex data type.
dataVertex data pointer.

◆ setVertexArrayData() [3/4]

void kanzi::Renderer::setVertexArrayData ( VertexAttribute::Semantic attribute,
const void * data,
unsigned int stride )
inline

Sets vertex array data wrapper.

Data type defaults to 32-bit float.

Parameters
attributeSemantic attribute.
dataVertex data pointer.
strideVertex stride in bytes.

◆ setVertexArrayData() [4/4]

void kanzi::Renderer::setVertexArrayData ( VertexAttribute::Semantic attribute,
const void * data )
inline

Sets vertex array data wrapper.

Data type defaults to 32-bit float. Stride defaults to 0u.

Parameters
attributeSemantic attribute.
dataVertex data pointer.

◆ endVertexArray()

void kanzi::Renderer::endVertexArray ( GraphicsPrimitiveType primitiveType,
unsigned int count )

Ends a vertex array. Renders the specified vertex lists and finishes the usage.

◆ getCurrentVertexArrayFlags()

unsigned int kanzi::Renderer::getCurrentVertexArrayFlags ( ) const

Gets the current vertex array flags from the renderer.

◆ getCurrentVertexArrayAttributeData()

const void * kanzi::Renderer::getCurrentVertexArrayAttributeData ( VertexAttribute::Semantic attribute) const

Gets the current vertex array data from the renderer. Reset when switching the shader.

◆ getLineWidth()

float kanzi::Renderer::getLineWidth ( ) const

Gets the line width assigned to the renderer.

The default line width is 1.0f.

Returns
Line width.
Since
Kanzi 3.9.4

◆ setLineWidth()

void kanzi::Renderer::setLineWidth ( float lineWidth)

Sets the line width for the renderer.

The default line width is 1.0f.

Parameters
lineWidthLine width.

◆ getPolygonDepthOffset()

Vector2 kanzi::Renderer::getPolygonDepthOffset ( ) const

Gets the polygon depth offset assigned to the renderer.

If the offset is Vector2(0.0f, 0.0f), the feature is disabled.

Returns
The polygon depth offset.
Since
Kanzi 3.9.4

◆ setPolygonDepthOffset() [1/2]

void kanzi::Renderer::setPolygonDepthOffset ( Vector2 offset)

Sets the polygon depth offset for the renderer.

This affects the depth offset of filled polygons only. Kanzi calculates the offset to add as:

dz * X + units * Y

Where:

  • dZ is the depth change derivative for the fragment.
  • units is the smallest measurable unit of depth.

To disable the feature, set both components to the default value 0.0f.

Parameters
offsetDepth offset multipliers (derivative, constant).
Since
Kanzi 3.9.4

◆ setPolygonDepthOffset() [2/2]

void kanzi::Renderer::setPolygonDepthOffset ( float derivativeMultiplier,
float constantMultiplier )
inline

Sets the polygon depth offset for the renderer.

Parameters
derivativeMultiplierMultiplier for the Z derivative.
constantMultiplierMultiplier for the constant units.
Since
Kanzi 3.9.4

◆ flush()

void kanzi::Renderer::flush ( ) const

Flushes the GPU pipeline, forces all commands to be executed in finite time.

◆ pushStatistics()

void kanzi::Renderer::pushStatistics ( )

◆ popStatistics()

void kanzi::Renderer::popStatistics ( )

◆ getIndexCount()

uint64_t kanzi::Renderer::getIndexCount ( ) const

Gets the index count from the renderer.

Since
Kanzi 3.9.7 changed the return type to uint64_t.

◆ getTriangleCount()

uint64_t kanzi::Renderer::getTriangleCount ( ) const

Gets the triangle count from the renderer.

Since
Kanzi 3.9.7 changed the return type to uint64_t.

◆ getVertexCount()

uint64_t kanzi::Renderer::getVertexCount ( ) const

Gets the vertex count from the renderer.

Since
Kanzi 3.9.7 changed the return type to uint64_t.

◆ getInstanceCount()

uint64_t kanzi::Renderer::getInstanceCount ( ) const

Gets the instance count from the renderer.

Since
Kanzi 3.9.7

◆ getBatchCount()

unsigned int kanzi::Renderer::getBatchCount ( ) const

Gets the batch count from the renderer. This is the number of draw calls, such as drawElements and drawArrays.

◆ getShaderSwitchCount()

unsigned int kanzi::Renderer::getShaderSwitchCount ( ) const

Gets the number of shader switches from the renderer.

◆ getUniformSendCount()

unsigned int kanzi::Renderer::getUniformSendCount ( ) const

Gets uniform sending count from the renderer.

◆ getTextureSwitchCount()

unsigned int kanzi::Renderer::getTextureSwitchCount ( ) const

Gets the number of texture switches from the renderer.

◆ getFramebufferSwitchCount()

unsigned int kanzi::Renderer::getFramebufferSwitchCount ( ) const

Gets the number of framebuffer switches from the renderer.

◆ getBufferSwitchCount()

unsigned int kanzi::Renderer::getBufferSwitchCount ( ) const

Gets the number of VBO and IBO switches from the renderer.

◆ getHeavyweightCallCount()

unsigned int kanzi::Renderer::getHeavyweightCallCount ( ) const

Returns the number of potentially heavyweight calls, such as buffer or texture updates and glFinish, from the renderer.

Potential due to GPU implementation can decide when heavyweight occurs. For example, reading cannot be performed before a write operation finishes.

Returns
The number of potentially heavyweight calls.

◆ isShaderBinaryFormatSupported()

bool kanzi::Renderer::isShaderBinaryFormatSupported ( unsigned int glShaderBinaryFormat) const

Returns whether a GL shader binary format is supported.

Parameters
glShaderBinaryFormatGL shader binary format to check.
Returns
If the shader binary format is supported, true, otherwise false.

◆ isProgramBinaryFormatSupported()

bool kanzi::Renderer::isProgramBinaryFormatSupported ( unsigned int glProgramBinaryFormat) const

Returns whether a GL program binary format is supported.

Parameters
glProgramBinaryFormatGL program binary format to check.
Returns
If the program binary format is supported, true, otherwise false.

◆ setGPUCallsEnabled()

void kanzi::Renderer::setGPUCallsEnabled ( bool enabled)

Sets GPU calls as enabled or disabled.

◆ GPUCallsIsEnabled()

bool kanzi::Renderer::GPUCallsIsEnabled ( ) const

Returns whether GPU calls are enabled.

Returns
If GPU calls are enabled, true, otherwise false.

◆ isSupported()

bool kanzi::Renderer::isSupported ( RendererSupport feature) const

Returns whether coverage buffer is supported.

Parameters
featureFeature to check.
Returns
If the feature is supported, true, otherwise false.

◆ getMultisampleSupport()

Multisample kanzi::Renderer::getMultisampleSupport ( ) const

Returns the support for multisample textures and renderbuffers.

Returns
Multisampling support enum.

◆ getProgramBinarySupport()

ProgramBinary kanzi::Renderer::getProgramBinarySupport ( ) const

Returns the support for program binaries.

Returns
Program binary support enum.

◆ getHalfFloatTextureSupport()

HalfFloatTexture kanzi::Renderer::getHalfFloatTextureSupport ( ) const

Returns the support for half float texture format.

Returns
Half float texture support enum.

◆ getHalfFloatVertexAttributeSupport()

HalfFloatVertexAttribute kanzi::Renderer::getHalfFloatVertexAttributeSupport ( ) const
inline

Returns the support for half-float vertex attribute.

Returns
Half-float vertex attribute support enum.

◆ isHalfFloatVertexAttributeSupported()

bool kanzi::Renderer::isHalfFloatVertexAttributeSupported ( ) const
inline

Returns whether half-float vertex attribute is supported.

Returns
If half-float vertex attribute is supported, true, otherwise false.

◆ getFloatTextureSupport()

FloatTexture kanzi::Renderer::getFloatTextureSupport ( ) const

Returns the support for float texture format.

Returns
Float texture support enum.

◆ getTexStorageSupport() [1/2]

TexStorage kanzi::Renderer::getTexStorageSupport ( ) const

Returns the support for tex storage.

Returns
Tex storage support enum.

◆ getDrawBuffersSupport()

DrawBuffers kanzi::Renderer::getDrawBuffersSupport ( ) const

Returns the support for draw buffers.

Returns
Draw buffers support enum.

◆ getTexStorageSupport() [2/2]

bool kanzi::Renderer::getTexStorageSupport ( TextureType type,
unsigned int samples ) const

Returns the support for tex storage.

Parameters
typeTexture type requested.
samplesSample count requested.
Returns
If tex storage is supported, true, otherwise false.

◆ createImageObject()

void * kanzi::Renderer::createImageObject ( void * dataPointer,
int target,
int * attributes )

Creates an image object, returns NULL if no hardware support.

Image object can be bound as texture input. Requires surface to be set for the renderer via setSurface, otherwise throws an error.

◆ deleteImageObject()

void kanzi::Renderer::deleteImageObject ( void * imageObject)

Deletes an image object created with createImageObject.

◆ setImageTargetTexture()

void kanzi::Renderer::setImageTargetTexture ( TextureType type,
void * imageObject )

Sets an image object bound to the currently bound texture type.

◆ getMaximumAnisotropy()

float kanzi::Renderer::getMaximumAnisotropy ( ) const

Gets the maximum anisotropy.

Returns
the maximum anisotropy.

◆ getMaximumTextureSize()

unsigned int kanzi::Renderer::getMaximumTextureSize ( TextureType textureType) const

Gets the maximum texture side size.

Returns
The maximum size of a texture side.

◆ getMaximumRenderbufferSize()

unsigned int kanzi::Renderer::getMaximumRenderbufferSize ( ) const

Gets the maximum renderbuffer size.

Returns
The maximum size of the renderbuffer.

◆ getMaximumViewportWidth()

unsigned int kanzi::Renderer::getMaximumViewportWidth ( ) const

Gets the maximum viewport width.

Returns
The maximum width of the viewport.

◆ getMaximumViewportHeight()

unsigned int kanzi::Renderer::getMaximumViewportHeight ( ) const

Gets the maximum viewport height.

Returns
The maximum height of the viewport.

◆ getMaximumVertexAttributeCount()

unsigned int kanzi::Renderer::getMaximumVertexAttributeCount ( ) const

Gets maximum vertex attribute count.

Returns
The maximum number of vertex attributes.

◆ getMaximumSampleCount()

unsigned int kanzi::Renderer::getMaximumSampleCount ( ) const

Gets maximum sample count for multisampling.

Returns
The maximum number of multisampling samples.

◆ getColorReadFormat()

int kanzi::Renderer::getColorReadFormat ( )

Returns the GL constant for the color read format.

The Renderer::ReadPixels function uses this when reading data from the current framebuffer.

Returns
The GL constant for the color read format.

◆ getColorReadType()

int kanzi::Renderer::getColorReadType ( )

Returns the GL constant for the color read type.

The Renderer::ReadPixels function uses this when reading data from the current framebuffer.

Returns
The GL constant for the color read type.

◆ invalidateAllocations()

void kanzi::Renderer::invalidateAllocations ( )

Invalidates all handles from the renderer without affecting the GL state.

◆ logOpenGLInformation()

void kanzi::Renderer::logOpenGLInformation ( unsigned int flags) const

Logs information about renderer capabilities.

◆ resolveMultisample() [1/4]

void kanzi::Renderer::resolveMultisample ( NativeFramebufferHandle sourceFramebuffer,
NativeFramebufferHandle destinationFramebuffer,
unsigned int srcOffsetX,
unsigned int srcOffsetY,
unsigned int srcWidth,
unsigned int srcHeight,
unsigned int dstOffsetX,
unsigned int dstOffsetY,
unsigned int dstWidth,
unsigned int dstHeight,
bool color,
bool depth,
bool stencil )

Resolves a multisample framebuffer.

Performs a blit from a source framebuffer to a destination framebuffer. This has the implicit effect of resolving multisample samples.

Parameters
sourceFramebufferSource framebuffer handle.
destinationFramebufferDestination framebuffer handle.
srcOffsetXCopied area x offset in source framebuffer.
srcOffsetYCopied area y offset in source framebuffer.
srcWidthCopied area width in source framebuffer.
srcHeightCopied area height in source framebuffer.
dstOffsetXCopied area x offset in destination framebuffer.
dstOffsetYCopied area y offset in destination framebuffer.
dstWidthCopied area width in destination framebuffer.
dstHeightCopied area height in destination framebuffer.
colorWhether to resolve the color channel.
depthWhether to resolve the depth channel.
stencilWhether to resolve the stencil channel.

◆ resolveMultisample() [2/4]

void kanzi::Renderer::resolveMultisample ( NativeFramebufferHandle sourceFramebuffer,
NativeFramebufferHandle destinationFramebuffer,
unsigned int srcOffsetX,
unsigned int srcOffsetY,
unsigned int srcWidth,
unsigned int srcHeight,
unsigned int dstOffsetX,
unsigned int dstOffsetY,
unsigned int dstWidth,
unsigned int dstHeight )
inline

Resolves a multisample framebuffer.

Performs a blit from a source framebuffer to a destination framebuffer. This has the implicit effect of resolving multisample samples. Only resolves the color buffer.

Parameters
sourceFramebufferSource framebuffer handle.
destinationFramebufferDestination framebuffer handle.
srcOffsetXCopied area x offset in source framebuffer.
srcOffsetYCopied area y offset in source framebuffer.
srcWidthCopied area width in source framebuffer.
srcHeightCopied area height in source framebuffer.
dstOffsetXCopied area x offset in destination framebuffer.
dstOffsetYCopied area y offset in destination framebuffer.
dstWidthCopied area width in destination framebuffer.
dstHeightCopied area height in destination framebuffer.

◆ resolveMultisample() [3/4]

void kanzi::Renderer::resolveMultisample ( Texture & src,
Texture & dst,
unsigned int offsetX,
unsigned int offsetY,
unsigned int width,
unsigned int height,
bool color,
bool depth )

Resolves multisample samples from a source texture to a destination texture.

Parameters
srcSource texture which has multisampling enabled.
dstDestination texture which has multisampling disabled.
offsetXCopied area x offset both in source and target texture.
offsetYCopied area y offset both in source and target texture.
widthWidth of the area to copy from source to destination.
heightHeight of the area to copy from source to destination.
colorWhether to resolve the color channel.
depthWhether to resolve the depth channel.

◆ resolveMultisample() [4/4]

void kanzi::Renderer::resolveMultisample ( Texture & src,
Texture & dst,
unsigned int offsetX,
unsigned int offsetY,
unsigned int width,
unsigned int height )
inline

Resolves multisample samples from a source texture to a destination texture.

Only resolves the color buffer.

Parameters
srcSource texture which has multisampling enabled.
dstDestination texture which has multisampling disabled.
offsetXCopied area x offset both in source and target texture.
offsetYCopied area y offset both in source and target texture.
widthWidth of the area to copy from source to destination.
heightHeight of the area to copy from source to destination.

◆ setFillMode()

void kanzi::Renderer::setFillMode ( GraphicsFillMode mode)

Sets the polygon fill mode if supported by the backend.

The default fill mode is kanzi::GraphicsFillModeSolid.

Parameters
modeThe polygon fill mode.
Since
Kanzi 3.9.9

◆ getViewport()

ViewportRectangle kanzi::Renderer::getViewport ( ) const
inline

Gets the current viewport rectangle from the renderer.

◆ getScissor()

ViewportRectangle kanzi::Renderer::getScissor ( ) const
inline

Gets the current scissor rectangle from the renderer.

Returns the rectangle even if the scissor test is not enabled. In this situation, it is the last set scissor rectangle.

Returns
The current scissor rectangle.

◆ enableWorkaround()

void kanzi::Renderer::enableWorkaround ( Workaround workaround)
inline

Enables a renderer workaround.

◆ disableWorkaround()

void kanzi::Renderer::disableWorkaround ( Workaround workaround)
inline

Disables a renderer workaround.

◆ isWorkaroundEnabled()

bool kanzi::Renderer::isWorkaroundEnabled ( Workaround workaround) const
inline

Return whether a workaround is enabled.

◆ setWorkaroundEnable()

void kanzi::Renderer::setWorkaroundEnable ( Workaround workaround,
bool enabled )
inline

Sets workaround enable state to true or false.

◆ findValidTextureFormat()

GraphicsFormat kanzi::Renderer::findValidTextureFormat ( GraphicsFormat format,
unsigned int features ) const

Finds a valid texture format that is supported by the graphics adapter and is compatible with a given graphics format.

The returned format must be binary-compatible with the format parameter. For example, input ETC1 format can return ETC2 format.

Parameters
formatThe format with which the result format should be compatible.
featuresUsage bits that should be supported by the format.
Returns
A format that is compatible with the requested format or, if no such format exists, kanzi::GraphicsFormatNone.

◆ getFeatures()

unsigned int kanzi::Renderer::getFeatures ( GraphicsFormat format) const

Describes the features for which a format can be used in the renderer.

◆ supports()

bool kanzi::Renderer::supports ( GraphicsFormat format,
unsigned int features ) const

Returns whether a graphics format supports given features.

Returns
If the format supports the features, true, otherwise false.

◆ supportsTexture()

bool kanzi::Renderer::supportsTexture ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a texture.

Returns
If the renderer can use the format as a texture, true, otherwise false.

◆ supportsRenderbuffer()

bool kanzi::Renderer::supportsRenderbuffer ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a renderbuffer.

Returns
If the renderer can use the format as a renderbuffer, true, otherwise false.

◆ supportsColorAttachment()

bool kanzi::Renderer::supportsColorAttachment ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a color attachment in framebuffers.

Returns
If the renderer can use the format as a color attachment in framebuffers, true, otherwise false.

◆ supportsDepthStencilAttachment()

bool kanzi::Renderer::supportsDepthStencilAttachment ( GraphicsFormat format) const

Returns whether the renderer can use a given graphics format as a depth-stencil attachment in framebuffers.

Returns
If the renderer can use the format as a depth-stencil attachment in framebuffers, true, otherwise false.

◆ getFallback()

GraphicsFormat kanzi::Renderer::getFallback ( GraphicsFormat format,
unsigned int usageFlags ) const

Returns a fallback graphics format that supports given usage flags.

Returns
The fallback format.

◆ getDepthStencilFormatForRenderbuffer()

GraphicsFormat kanzi::Renderer::getDepthStencilFormatForRenderbuffer ( bool depth,
bool stencil ) const

Returns a depth-stencil renderbuffer format that is supported by the renderer.

Returns
The depth-stencil renderbuffer format.

◆ getDepthStencilFormatForTexture()

GraphicsFormat kanzi::Renderer::getDepthStencilFormatForTexture ( bool depth,
bool stencil ) const

Returns a depth-stencil texture format that is supported by the renderer.

Returns
The depth-stencil texture format.

◆ applyAttributePointer() [1/2]

void kanzi::Renderer::applyAttributePointer ( unsigned int location,
int dimension,
GraphicsDataType dataType,
int stride,
const void * data ) const
inline

For a given vertex attribute, specified by attribute location, configures attribute dimension, datatype, stride, and starting offset in the current vertex buffer.

Note
Kanzi sources the attribute data from the vertex buffer (GPU memory) that is current at the time of the function call. If the current vertex buffer is zero, Kanzi sources the attribute data from CPU memory. In OpenGL, this is known as "client side data".
Parameters
locationAttribute location to modify.
dimensionDimension for the attribute. Valid values are 1, 2, 3, and 4.
dataTypeData type for the attribute.
strideStride for the attribute. Valid values are positive integers.
dataStarting offset of the attribute data in the current vertex buffer GPU memory. If the current vertex buffer is 0, this is the starting address for the attribute data in CPU memory.

◆ applyAttributePointer() [2/2]

void kanzi::Renderer::applyAttributePointer ( unsigned int location,
int dimension,
GraphicsDataType dataType,
int stride,
unsigned int divisor,
const void * data ) const

For a given vertex or instance attribute specified by location, configures the dimension, datatype, stride, and starting offset in the current vertex buffer.

Note
Kanzi sources the attribute data from the vertex buffer (GPU memory) that is current at the time of the function call. If the current vertex buffer is zero, Kanzi sources the attribute data from CPU memory. In OpenGL, this is known as "client side data".
Parameters
locationAttribute location to modify.
dimensionDimension for the attribute. Valid values are 1, 2, 3, and 4.
dataTypeData type for the attribute.
strideStride for the attribute. Valid values are positive integers.
divisorDivisor for the attribute. Value 0 means that the attribute is per vertex. Values 1 and higher mean that the attribute is per instance.
dataStarting offset of the attribute data in the current vertex buffer GPU memory. If the current vertex buffer is 0, this is the starting address for the attribute data in CPU memory.
Since
Kanzi 3.9.6

◆ getGLFormatTriplet()

void kanzi::Renderer::getGLFormatTriplet ( GraphicsFormat format,
unsigned int features,
unsigned int * out_glFormat,
unsigned int * out_glInternalFormat,
unsigned int * out_glType ) const

Writes the GL API format, internal format, and type of a given graphics format to the output parameters.

Parameters
formatGraphics format.
featuresGraphics format features.
out_glFormatOutput variable for GL format enumeration.
out_glInternalFormatOutput variable for GL internal format enumeration.
out_glTypeOutput variable for GL data type enumeration.

◆ supportsTexStorage()

bool kanzi::Renderer::supportsTexStorage ( GraphicsFormat format,
unsigned int features ) const

Returns whether a graphics format supports texture storage.

Returns
If the graphics format supports texture storage, true, otherwise false.

◆ clearUniformCaches()

void kanzi::Renderer::clearUniformCaches ( )

Free memory used by uniform caches.

◆ advanceGlobalTime()

void kanzi::Renderer::advanceGlobalTime ( chrono::milliseconds deltaTime)

Advances the renderer wall clock with time delta.

Parameters
deltaTimeWall clock delta time.

◆ getGlobalTime()

chrono::milliseconds kanzi::Renderer::getGlobalTime ( ) const

Gets the wall clock time in milliseconds since program start.

This time is monotonically increasing and not affected by time zone changes.

Returns
Global time in milliseconds.

◆ getGlesVersion()

int kanzi::Renderer::getGlesVersion ( ) const

Returns the supported OpenGL ES version.

The version is encoded into an integer using this formula: major version times 100 plus minor version times ten. For example, value 310 means version 3.1.

Returns
OpenGL ES version number encoded to an integer using the formula "major version times 100 plus minor version times ten".

◆ getLogging()

bool kanzi::Renderer::getLogging ( ) const

Returns whether the logging of OpenGL API calls is enabled.

Returns
If logging is enabled, true, otherwise false.

◆ getDumpStateOnDrawCalls()

bool kanzi::Renderer::getDumpStateOnDrawCalls ( ) const

Returns current dump state on draw calls setting.

Returns
If dump state on draw calls is enabled, true, otherwise false.

◆ setLogging()

void kanzi::Renderer::setLogging ( bool enabled,
bool dumpStateOnDrawCalls )

Enables or disables the logging of OpenGL API calls.

Parameters
enabledWhether to enable the logging of OpenGL API calls.
dumpStateOnDrawCallsNew dump state on draw calls setting.

◆ setHasTessellationShader()

void kanzi::Renderer::setHasTessellationShader ( bool hasTessellationShader)
inline

Sets whether the current program has an active tessellation shader, which requires overriding the primitive type to GL_PATCHES.

Parameters
hasTessellationShaderWhether the program has an active tessellation shader.
Since
Kanzi 3.9.6

◆ loadProgramFromCache()

bool kanzi::Renderer::loadProgramFromCache ( const ShaderProgram::CreateInfo & info,
unsigned int program )

Tries to load a shader program from the cache.

Parameters
infoShader create info with shader sources.
programGL program handle.
Returns
If loading the program from the cache succeeds, true, otherwise false.
Since
Kanzi 3.9.8

◆ saveProgramToCache()

void kanzi::Renderer::saveProgramToCache ( const ShaderProgram::CreateInfo & info,
unsigned int program )

Saves a shader program to cache.

Parameters
infoShader create info with shader sources.
programGL program handle.
Since
Kanzi 3.9.8

◆ getCacheFilePath()

string kanzi::Renderer::getCacheFilePath ( const ShaderProgram::CreateInfo & info)

Forms a full shader cache file path from the shader create info.

Parameters
infoShader create info with shader sources.
Returns
Full path to shader cache file.
Since
Kanzi 3.9.8

◆ setScreenSize()

void kanzi::Renderer::setScreenSize ( Vector2 screenSize)
inline

Sets the current screen size.

Parameters
screenSizeThe screen size in pixels.
Since
Kanzi 3.9.9

Friends And Related Symbol Documentation

◆ operator&=

And assignment operator for rendering change state flags.

Parameters
lhsLeft-hand-side operand.
rhsRight-hand-side operand.
Returns
Modified change state flag.

◆ operator|=

Or assignment operator for rendering change state flags.

Parameters
lhsLeft-hand-side operand.
rhsRight-hand-side operand.
Returns
Modified change state flag.

◆ operator^=

Xor assignment operator for rendering change state flags.

Parameters
lhsLeft-hand-side operand.
rhsRight-hand-side operand.
Returns
Modified change state flag.

The documentation for this class was generated from the following file: